<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of rbfComputeBasis</title>
  <meta name="keywords" content="rbfComputeBasis">
  <meta name="description" content="Get locations and sizes of radial basis functions for use in rbf network.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html classify -->
<h1>rbfComputeBasis
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Get locations and sizes of radial basis functions for use in rbf network.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function rbfBasis = rbfComputeBasis( X, k, cluster, scale, show ) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Get locations and sizes of radial basis functions for use in rbf network.

 Radial basis function are a simple, fast method for universal function
 approximation / regression. The idea is to find a mapping X-&gt;y where X
 and y are continuous real variables. The mapping is linear over features
 of X: y=rbfWeight*features(X). The features are of the form:
  f_j(x) = exp(-||x-mu_j||_2^2 / 2 sig_j^2 ).
 The number of basis functions controls the complexity of the network. Too
 many basis functions can lead to overfitting, too few to bad
 interpolation. Rbf networks are trained in two phases.  First, the radial
 basis functions are found in an unsupervised manner (using only Xtrain),
 for example by clustering Xtrain.  Next, given the basis functions,
 Xtrain and ytrain, the basis weights are found by solving the system:
  rbfWeight * features(Xtrain) = ytrain
 At this point, to interpolate any new points, Xtest, use:
  ytest = rbfWeight * features(Xtest)
 The code below achieves all three steps:
  rbfBasis  = rbfComputeBasis( Xtrain, k, cluster, scale, show );
  rbfWeight = rbfComputeFtrs(Xtrain,rbfBasis) \ ytrain;
  ytest     = rbfComputeFtrs(Xtest,rbfBasis) * rbfWeight;
 Note, in the returned rbfBasis struct there are a number of flags that
 control how the rbf features are computed. These can be altered to
 achieve the desired effect.

 For an in depth discussion of rbf networks see:
  Christopher M. Bishop. &quot;Neural Networks for Pattern Recognition&quot;

 USAGE
  rbfBasis = rbfComputeBasis( X, k, [cluster], [scale], [show] )

 INPUTS
  X           - [N x d] N points of d dimensions each
  k           - number of basis functions to use
  cluster     - [1]: Computes cluster centers for use as rbf functions.
              - 0: Evenly centered basis functions (ok for small d)
  scale       - [5] Alter computed value of sigma by given factor
                set larger for smoother results, too small -&gt; bad interp
  show        - [0] will display results in figure(show)
                if show&lt;0, assumes X is array Nxs^2 of N sxs patches

 OUTPUTS
  rfbBasis
   .d          - feature vector size
   .k          - number of basis functions actually used
   .mu         - [d x k] rbf centers
   .vars       - [1 x k] rbf widths
   .var        - rbf average width
   .globalVar  - [1] if true use single average var for rbfs
   .constant   - [0] if true include extra basis with constant activation
   .normalize  - [0] if true normalize overall rbf response to sum to 1

 EXAMPLE

 See also <a href="rbfDemo.html" class="code" title="function rbfDemo( dataType, noiseSig, scale, k, cluster, show )">RBFDEMO</a>, <a href="rbfComputeFtrs.html" class="code" title="function Xrbf = rbfComputeFtrs( X, rbfBasis )">RBFCOMPUTEFTRS</a>

 Piotr's Computer Vision Matlab Toolbox      Version 2.50
 Copyright 2014 Piotr Dollar.  [pdollar-at-gmail.com]
 Licensed under the Simplified BSD License [see external/bsd.txt]</pre></div>





<!-- Start of Google Analytics Code -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4884268-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- end of Google Analytics Code -->

<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2003</address>
</body>
</html>
